package com.augmentum.oes.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.augmentum.oes.util.FormatTimeUtil;

public class Exam implements Serializable {

    private static final long serialVersionUID = -6301339778854902203L;

    private int id;
    private String examName;
    private String description;
    private String effectiveTime;
    private int duration;
    private int questionQuantity;
    private float questionPoints;
    private float totalScore;
    private float passCriteria;
    private float averageScore;
    private int examineeCount;
    private String passRate;
    private Date createTime;
    private boolean isDrop;
    private Date updateTime;
    private User creator;
    private boolean draft;

    private List<Question> questions = new ArrayList<Question>();

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getEffectiveTime() {
        return effectiveTime;
    }

    public void setEffectiveTime(String effectiveTime) {
        this.effectiveTime = FormatTimeUtil.getSimpleTime(effectiveTime);
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public int getQuestionQuantity() {
        return questionQuantity;
    }

    public void setQuestionQuantity(int questionQuantity) {
        this.questionQuantity = questionQuantity;
    }

    public float getQuestionPoints() {
        return questionPoints;
    }

    public void setQuestionPoints(float questionPoints) {
        this.questionPoints = questionPoints;
    }

    public float getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(float totalScore) {
        this.totalScore = totalScore;
    }

    public float getPassCriteria() {
        return passCriteria;
    }

    public void setPassCriteria(float passCriteria) {
        this.passCriteria = passCriteria;
    }

    public float getAverageScore() {
        return averageScore;
    }

    public void setAverageScore(float averageScore) {
        this.averageScore = averageScore;
    }

    public int getExamineeCount() {
        return examineeCount;
    }

    public void setExamineeCount(int examineeCount) {
        this.examineeCount = examineeCount;
    }

    public String getPassRate() {
        return passRate;
    }

    public void setPassRate(String passRate) {
        this.passRate = passRate;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public boolean isDrop() {
        return isDrop;
    }

    public void setDrop(boolean isDrop) {
        this.isDrop = isDrop;
    }

    public User getCreator() {
        return creator;
    }

    public void setCreator(User creator) {
        this.creator = creator;
    }

    public List<Question> getQuestions() {
        return questions;
    }

    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public boolean isDraft() {
        return draft;
    }

    public void setDraft(boolean draft) {
        this.draft = draft;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Exam [id=");
        builder.append(id);
        builder.append(", examName=");
        builder.append(examName);
        builder.append(", description=");
        builder.append(description);
        builder.append(", effectiveTime=");
        builder.append(effectiveTime);
        builder.append(", duration=");
        builder.append(duration);
        builder.append(", questionQuantity=");
        builder.append(questionQuantity);
        builder.append(", questionPoints=");
        builder.append(questionPoints);
        builder.append(", totalScore=");
        builder.append(totalScore);
        builder.append(", passCriteria=");
        builder.append(passCriteria);
        builder.append(", averageScore=");
        builder.append(averageScore);
        builder.append(", examineeCount=");
        builder.append(examineeCount);
        builder.append(", passRate=");
        builder.append(passRate);
        builder.append(", createTime=");
        builder.append(createTime);
        builder.append(", isDrop=");
        builder.append(isDrop);
        builder.append("]");
        return builder.toString();
    }

}
